home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / c-tools / c_examples / appicon / appicon_example.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-19  |  1.5 KB  |  62 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. // AppIcon.cpp
  3.  
  4. //////////////////////////////////////////////////////////////////////////////
  5. // Includes
  6. #include "aframe:include/amigaapp.hpp"
  7. #include "aframe:include/window.hpp"
  8. #include "aframe:include/rect.hpp"
  9. #include "aframe:include/reqtools.hpp"
  10. #include "aframe:include/appicon.hpp"
  11.  
  12. #include <workbench/startup.h>
  13. #include <workbench/workbench.h>
  14.  
  15. extern struct Image About_image;
  16.  
  17. //////////////////////////////////////////////////////////////////////////////
  18. // ControlWindow Class Definition
  19.  
  20. class ControlWindow : public AFWindow
  21.  
  22. {
  23. public:
  24.     virtual void OnAppIcon(LPAppMessage amess);
  25.  
  26.     AFAppIcon appicon;
  27.     AFReqTools rt;
  28. };
  29.  
  30. //////////////////////////////////////////////////////////////////////////////
  31. // ControlWindow Implementation routines
  32.  
  33. void ControlWindow::OnAppIcon(LPAppMessage amess)
  34. {
  35.     struct WBArg    *argptr;
  36.     int i;
  37.  
  38.     argptr = amess->am_ArgList;
  39.  
  40.     for(i=0;i<amess->am_NumArgs;i++) {
  41.         printf("Items: %s\n",argptr->wa_Name);
  42.         argptr++;
  43.     }
  44. }
  45.  
  46. //////////////////////////////////////////////////////////////////////////////
  47. // MAIN
  48.  
  49. void main()
  50. {
  51.     AFAmigaApp theApp;
  52.     ControlWindow win;
  53.     AFRect rect(10,10,410,310);
  54.  
  55.     win.Create(&theApp,&rect,"AFrame AppIcon Example");
  56.  
  57.     win.appicon.Create(&theApp, &About_image, NULL, 1, (char*)"AFrame AppIcon");
  58.     win.rt.EZRequest("Drop a file(s) on me","Ok");
  59.  
  60.     theApp.RunApp();
  61. }
  62.